const {
    contextBridge,
    ipcRenderer
} = require('electron');


ipcRenderer.send('fetchData', 'https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1');

ipcRenderer.on('fetchDataResponse', (event, response) => {
    console.log(response);
    window.postMessage({ type: "backgroundImg", res: response })
})

contextBridge.exposeInMainWorld('wss', {
    config: () => ipcRenderer.invoke('websocket-config')
})

console.log(location.href)
window.addEventListener('load', () => {
    console.log(document.title)
})

window.addEventListener('hashchange', e => {
    console.log(e);
})